package org.railage.server.dao;

import java.util.List;

import org.railage.server.entities.Station;

/**
 * DAO for station entity.
 * 
 * @author Cyril Fertikov
 * 
 */
public interface StationDAO {

	/**
	 * Adds new station.
	 * 
	 * @param stationName
	 *            Name of new station.
	 * @return Result value:<br>
	 *         0 - added successfully,<br>
	 *         1 - station with given name already exists,<br>
	 *         -1 - DB session error.
	 */
	int addStation(String stationName);

	/**
	 * Deletes station.
	 * 
	 * @param stationName
	 *            Name of station to delete.
	 * @return Result value:<br>
	 *         0 - deleted successfully,<br>
	 *         1 - station does not exist,<br>
	 *         2 - station is on route,<br>
	 *         -1 - DB session error.
	 */
	int deleteStation(String stationName);

	/**
	 * Gets all existing stations.
	 * 
	 * @return List of stations.
	 */
	List<Station> getAllStations();

	/**
	 * Gets sequenced list of trip's stations.
	 * 
	 * @param tripID
	 *            Trip ID.
	 * @return List of stations.
	 */
	List<Station> getOrderedStationsOfTrip(int tripID);
}
